libxl: close fd's in parent when spawning qdisk
authorIan Campbell <ian.campbell@citrix.com>
Tue, 16 Feb 2016 11:49:53 +0000 (11:49 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 16 Feb 2016 17:42:53 +0000 (17:42 +0000)
commite33b2921d28c8a3aff2c25fd3d046c7432b3a606
treeb874600d454ab48c1054c52d2a3dba31371f77c5
parentb021beb21a977a89b763db7b7df7c362cf8640a8
libxl: close fd's in parent when spawning qdisk

Coverity points out that these remain open in the parent upon
success, which is a resource leak.

To fix this rejig the exit paths such that success and error cases
both close the two fds, this means adjusting the callback to only
happen for the error case and it also makes sense to rename the label
from "error" to just "out".

Compile tested only.

CID: 1130518 (null) and 1130517 (logfile_w).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_dm.c